home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 2004 Junue - Disc 1 / MacFormat 143 CD1.iso / Serious Software / RealCADD3.05.sit / RealCADD3.05 / scripts / Do_x_y < prev    next >
Text File  |  2003-04-11  |  2KB  |  76 lines

  1. RCAD script
  2. 1.00
  3. Do_x_y
  4. doxyup
  5. doxydown
  6. 3
  7. 0
  8. 1
  9. 1er clic = reference ? (yes/oui or no/non)
  10. Font
  11. Size
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. oui
  20. Helvetica
  21. 10
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. Dim s_x, s_y, s_x1,s_y1,s_x2,s_y2 as double
  30. Dim s_t as integer
  31.  
  32. if GlobalScript1 < 0 then
  33.    if (userinput1 = "yes") or (userinput1 = "oui") then
  34.       GlobalScript1 = Firstx
  35.       GlobalScript2 = Firsty
  36.    else
  37.       GlobalScript1 = 0
  38.       GlobalScript2 = 0
  39.    end if
  40. end if
  41. s_t = val(userinput3)
  42. Add_Line(Firstx, Firsty, Lastx, Lasty, 0.25, 7, False, True, False)
  43. s_x = Global_x(Firstx) - Global_x(GlobalScript1)
  44. s_y = Global_y(Firsty) - Global_y(GlobalScript2)
  45. if Lastx > Firstx then
  46.    Add_String("x = " + Format(s_x,"-#.000"), Lastx + 3, Lasty - 2, s_t, 0, False, False, False, 7, 0, userinput2, False, False, 0)
  47.    BoundRectLastObject
  48.    s_x1 = BoundRectMinx
  49.    s_y1 = BoundRectMiny
  50.    s_x2 = BoundRectMaxx
  51.    s_y2 = BoundRectMaxy
  52.    Add_String("y = " + Format(s_y,"-#.000"), Lastx + 3, Lasty + 12, s_t, 0, False, False, False, 7, 0, userinput2, False, False, 0)
  53. else
  54.    Add_String("x = " + Format(s_x,"-#.000"), Lastx - 3, Lasty - 2, s_t, 2, False, False, False, 7, 0, userinput2, False, False, 0)
  55.    BoundRectLastObject
  56.    s_x1 = BoundRectMinx
  57.    s_y1 = BoundRectMiny
  58.    s_x2 = BoundRectMaxx
  59.    s_y2 = BoundRectMaxy
  60.    Add_String("y = " + Format(s_y,"-#.000"), Lastx - 3, Lasty + 12, s_t, 2, False, False, False, 7, 0, userinput2, False, False, 0)
  61. end if
  62. BoundRectLastObject
  63. if BoundRectMinx < s_x1 then
  64.    s_x1 = BoundRectMinx
  65. end if
  66. if BoundRectMiny < s_y1 then
  67.    s_y1 = BoundRectMiny
  68. end if
  69. if BoundRectMaxx > s_x2 then
  70.    s_x2 = BoundRectMaxx
  71. end if
  72. if BoundRectMaxy > s_y2 then
  73.    s_y2 = BoundRectMaxy
  74. end if
  75. Add_Rect(s_x1 - 3, s_y1 - 3, s_x2 + 3, s_y2 + 3, 0.25, 7, 0, False)
  76.